Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output server logs and handle SIGTERM #68

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Guiorgy
Copy link

@Guiorgy Guiorgy commented Aug 28, 2024

svnserve has the option --log-file:

  --log-file ARG           : svnserve log file

I added a docker-entrypoint.sh script that creates a named pipe using mkfifo, runs svnserve in the background and then redirects logs from the named pipe to the stdout for Docker. Once a SIGTERM is received, sends the SIGTERM signal to the svnserve in the background.

I also added the .gitattributes file, since I'm on Windows git tries to 'fix' line endings to \r\n and Docker doesn't like that.

And finally, before the container would never terminate gracefully when stopped, it would always be killed after the grace period. Now, the SIGTERM signal should be correctly forwarded to svnserve, which closes the named pipe after it's done, which also breaks the while loop terminating the whole entrypoint script.

define the entrypoint after installing dependencies, so the dependencies can be cached for subsequent builds
@Guiorgy Guiorgy marked this pull request as draft August 29, 2024 11:57
Also replaced cat with a while to avoid creating a subshell.
Together, this allows for proper handling of the SIGTERM signal when stopping the container.
@Guiorgy Guiorgy marked this pull request as ready for review August 29, 2024 12:27
@Guiorgy Guiorgy changed the title Output server logs Output server logs and handle SIGTERM Aug 29, 2024
@Guiorgy Guiorgy marked this pull request as draft September 26, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant